﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;

namespace formworks.old
{
    /// <summary>
    /// 字段描述
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class Fields : Attribute
    {
        /// <summary>
        /// 字段描述
        /// 名称
        /// 类型
        /// 最大长度
        /// 可为空
        /// 是否自动增长
        /// 描述信息
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="dataType">类型</param>
        /// <param name="maxLength">最大长度</param>
        /// <param name="isNullAble">可为空</param>
        /// <param name="isIdentity">是否自动增长</param>
        /// <param name="description">描述信息</param>
        public Fields(string name,
            string dataType,
            int maxLength,
            bool isNullAble,
            int isIdentity,
            string description)
        {
            this.name = name;
            this.dataType = dataType;
            this.isNullAble = isNullAble;
            this.isIdentity = isIdentity;
            this.description = description;
        }

        /// <summary>
        /// 字段的名字
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 数据类型
        /// </summary>
        public string dataType { get; set;}

        /// <summary>
        /// 数据库可保存长度
        /// </summary>
        public int maxLength { get; set; }

        /// <summary>
        /// 是否允许为空
        /// </summary>
        public bool isNullAble { get; set; }

        /// <summary>
        /// 字段是否是自动增长的
        /// </summary>
        public int isIdentity { get; set; }

        /// <summary>
        /// 字段的描述信息
        /// </summary>
        public string description { get; set; }


    }


}
